package besta.moon.engine.index;

import besta.moon.engine.IndexNode;

final public class IndexNodeScrollStatus {

    public final boolean asc;
    public final IndexNode[] nodes;

    public int idx;
    public final Object nodeValue;

    public final int level;

    public IndexNodeScrollStatus(IndexNode node, boolean asc, boolean scroll, int level) {
        this.nodes = node.getChildNodes();
        nodeValue = node.getValue();
        this.asc = asc;
        this.idx = (asc ^ scroll) ? nodes.length : -2;
        this.level = level;
    }

    public void afterLast() {
        idx = (asc) ? nodes.length : -2;
    }

}
